import { registerClass } from "../../../cfw/tools/class_decorator";
import { SDKSystem } from "../../core/system/SDKSystem";

@registerClass('QQSystem')
export class QQSystem extends SDKSystem {
    hasShare(): boolean {
        return true;
    }
    exitApplication() {
        this.sdk.exitMiniProgram({
            success: () => { },
            fail: () => { },
            complete: () => { }
        })
    }


    showToast(title: string) {
        this.sdk.showToast({ title: title })
    }

    vibrateShort() {
        this.sdk.vibrateShort();
    }

    postMessage(message: any) {

    }



    previewImage(imgUrl: string) {
        this.sdk.previewImage({
            current: imgUrl, // 当前显示图片的http链接
            urls: [imgUrl] // 需要预览的图片http链接列表
        })
    }

    navigateToMiniProgram(appID: string) {
        this.sdk.navigateToMiniProgram({
            appId: appID,
            success: () => {

            }
        })
    }
}